#ifndef PROJECTBUILDTARGET_H
#define PROJECTBUILDTARGET_H

#include "globals.h"
#include "compiletargetbase.h"
#include "projectfile.h"
#include <wx/dynarray.h>
#include <wx/filename.h>
#include <wx/list.h>
#include <wx/treectrl.h>

class M_Code_Project;
class ProjectBuildTarget;

WX_DEFINE_ARRAY( ProjectBuildTarget*, BuildTargets);

class ProjectBuildTarget : public CompileTargetBase {
  public:
    ProjectBuildTarget( M_Code_Project* parentProject );
    ~ProjectBuildTarget();
    virtual M_Code_Project* GetParentProject();
    virtual wxString GetFullTitle() const;
    virtual const wxString& GetExternalDeps() const;
    virtual void SetExternalDeps( const wxString& deps );
    virtual const wxString& GetAdditionalOutputFiles() const;
    virtual void SetAdditionalOutputFiles( const wxString& files );
    virtual bool GetIncludeInTargetAll() const;
    virtual void SetIncludeInTargetAll( bool buildIt );
    virtual bool GetCreateDefFile() const;
    virtual void SetCreateDefFile( bool createIt );
    virtual bool GetCreateStaticLib();
    virtual void SetCreateStaticLib( bool createIt );
    virtual bool GetUseConsoleRunner() const;
    virtual void SetUseConsoleRunner( bool useIt );
    virtual void SetTargetType( TargetType pt );
    virtual void AddTargetDep( ProjectBuildTarget* target );
    virtual BuildTargets& GetTargetDeps();
    virtual FilesList& GetFilesList() { return m_Files; }
    int GetFilesCount() { return m_Files.size(); }
    ProjectFile* GetFile( int index );
    bool RemoveFile( ProjectFile* pf );
  private:
    friend class ProjectFile;
    M_Code_Project* m_Project;
    wxString m_ExternalDeps;
    wxString m_AdditionalOutputFiles;
    BuildTargets m_TargetDeps;
    FilesList m_Files;
    ProjectFileArray m_FileArray;
    bool m_BuildWithAll;
    bool m_CreateStaticLib;
    bool m_CreateDefFile;
    bool m_UseConsoleRunner;
};

#endif
